public class likouNode {

}

 class ListNode
 {
     int val;
     ListNode next;
     ListNode() {}
     ListNode(int val) { this.val = val; }
     ListNode(int val, ListNode next) { this.val = val; this.next = next; }
  }

class Solution
{
    public ListNode removeElements(ListNode head, int val)
    {
        ListNode newHead = new ListNode(-10);
        ListNode temp = newHead;
        ListNode cur  = head;
        if (head == null)  return head;
        while(cur != null)
        {
            if(cur.val != val)
            {
                temp.next = cur;
                temp = temp.next;
            }

            cur = cur.next;
        }
        return head;

    }

}